home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / necko / nsIFileProtocolHandler.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  155 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIFileProtocolHandler.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIFileProtocolHandler_h__
  6. #define __gen_nsIFileProtocolHandler_h__
  7.  
  8.  
  9. #ifndef __gen_nsIProtocolHandler_h__
  10. #include "nsIProtocolHandler.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIFile; /* forward declaration */
  18.  
  19.  
  20. /* starting interface:    nsIFileProtocolHandler */
  21. #define NS_IFILEPROTOCOLHANDLER_IID_STR "255602ea-c31f-4d29-8f35-905ead3f76f4"
  22.  
  23. #define NS_IFILEPROTOCOLHANDLER_IID \
  24.   {0x255602ea, 0xc31f, 0x4d29, \
  25.     { 0x8f, 0x35, 0x90, 0x5e, 0xad, 0x3f, 0x76, 0xf4 }}
  26.  
  27. class NS_NO_VTABLE nsIFileProtocolHandler : public nsIProtocolHandler {
  28.  public: 
  29.  
  30.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFILEPROTOCOLHANDLER_IID)
  31.  
  32.   /**
  33.      * This method constructs a new file URI 
  34.      *
  35.      * @param aFile nsIFile
  36.      * @return reference to a new nsIURI object
  37.      */
  38.   /* nsIURI newFileURI (in nsIFile aFile); */
  39.   NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI **_retval) = 0;
  40.  
  41.   /**
  42.      * Converts the nsIFile to the corresponding URL string.  NOTE: under
  43.      * some platforms this is a lossy conversion (e.g., Mac Carbon build).
  44.      * If the nsIFile is a local file, then the result will be a file://
  45.      * URL string.
  46.      *
  47.      * The resulting string may contain URL-escaped characters.
  48.      */
  49.   /* AUTF8String getURLSpecFromFile (in nsIFile file); */
  50.   NS_IMETHOD GetURLSpecFromFile(nsIFile *file, nsACString & _retval) = 0;
  51.  
  52.   /**
  53.      * Converts the URL string into the corresponding nsIFile if possible.
  54.      * A local file will be created if the URL string begins with file://.
  55.      */
  56.   /* nsIFile getFileFromURLSpec (in AUTF8String url); */
  57.   NS_IMETHOD GetFileFromURLSpec(const nsACString & url, nsIFile **_retval) = 0;
  58.  
  59.   /**
  60.      * Takes a local file and tries to interpret it as an internet shortcut
  61.      * (e.g. .url files on windows).
  62.      * @param file The local file to read
  63.      * @return The URI the file refers to
  64.      *
  65.      * @throw NS_ERROR_NOT_AVAILABLE if the OS does not support such files.
  66.      * @throw NS_ERROR_NOT_AVAILABLE if this file is not an internet shortcut.
  67.      */
  68.   /* nsIURI readURLFile (in nsIFile file); */
  69.   NS_IMETHOD ReadURLFile(nsIFile *file, nsIURI **_retval) = 0;
  70.  
  71. };
  72.  
  73. /* Use this macro when declaring classes that implement this interface. */
  74. #define NS_DECL_NSIFILEPROTOCOLHANDLER \
  75.   NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI **_retval); \
  76.   NS_IMETHOD GetURLSpecFromFile(nsIFile *file, nsACString & _retval); \
  77.   NS_IMETHOD GetFileFromURLSpec(const nsACString & url, nsIFile **_retval); \
  78.   NS_IMETHOD ReadURLFile(nsIFile *file, nsIURI **_retval); 
  79.  
  80. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  81. #define NS_FORWARD_NSIFILEPROTOCOLHANDLER(_to) \
  82.   NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI **_retval) { return _to NewFileURI(aFile, _retval); } \
  83.   NS_IMETHOD GetURLSpecFromFile(nsIFile *file, nsACString & _retval) { return _to GetURLSpecFromFile(file, _retval); } \
  84.   NS_IMETHOD GetFileFromURLSpec(const nsACString & url, nsIFile **_retval) { return _to GetFileFromURLSpec(url, _retval); } \
  85.   NS_IMETHOD ReadURLFile(nsIFile *file, nsIURI **_retval) { return _to ReadURLFile(file, _retval); } 
  86.  
  87. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  88. #define NS_FORWARD_SAFE_NSIFILEPROTOCOLHANDLER(_to) \
  89.   NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewFileURI(aFile, _retval); } \
  90.   NS_IMETHOD GetURLSpecFromFile(nsIFile *file, nsACString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetURLSpecFromFile(file, _retval); } \
  91.   NS_IMETHOD GetFileFromURLSpec(const nsACString & url, nsIFile **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFileFromURLSpec(url, _retval); } \
  92.   NS_IMETHOD ReadURLFile(nsIFile *file, nsIURI **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadURLFile(file, _retval); } 
  93.  
  94. #if 0
  95. /* Use the code below as a template for the implementation class for this interface. */
  96.  
  97. /* Header file */
  98. class nsFileProtocolHandler : public nsIFileProtocolHandler
  99. {
  100. public:
  101.   NS_DECL_ISUPPORTS
  102.   NS_DECL_NSIFILEPROTOCOLHANDLER
  103.  
  104.   nsFileProtocolHandler();
  105.  
  106. private:
  107.   ~nsFileProtocolHandler();
  108.  
  109. protected:
  110.   /* additional members */
  111. };
  112.  
  113. /* Implementation file */
  114. NS_IMPL_ISUPPORTS1(nsFileProtocolHandler, nsIFileProtocolHandler)
  115.  
  116. nsFileProtocolHandler::nsFileProtocolHandler()
  117. {
  118.   /* member initializers and constructor code */
  119. }
  120.  
  121. nsFileProtocolHandler::~nsFileProtocolHandler()
  122. {
  123.   /* destructor code */
  124. }
  125.  
  126. /* nsIURI newFileURI (in nsIFile aFile); */
  127. NS_IMETHODIMP nsFileProtocolHandler::NewFileURI(nsIFile *aFile, nsIURI **_retval)
  128. {
  129.     return NS_ERROR_NOT_IMPLEMENTED;
  130. }
  131.  
  132. /* AUTF8String getURLSpecFromFile (in nsIFile file); */
  133. NS_IMETHODIMP nsFileProtocolHandler::GetURLSpecFromFile(nsIFile *file, nsACString & _retval)
  134. {
  135.     return NS_ERROR_NOT_IMPLEMENTED;
  136. }
  137.  
  138. /* nsIFile getFileFromURLSpec (in AUTF8String url); */
  139. NS_IMETHODIMP nsFileProtocolHandler::GetFileFromURLSpec(const nsACString & url, nsIFile **_retval)
  140. {
  141.     return NS_ERROR_NOT_IMPLEMENTED;
  142. }
  143.  
  144. /* nsIURI readURLFile (in nsIFile file); */
  145. NS_IMETHODIMP nsFileProtocolHandler::ReadURLFile(nsIFile *file, nsIURI **_retval)
  146. {
  147.     return NS_ERROR_NOT_IMPLEMENTED;
  148. }
  149.  
  150. /* End of implementation class template. */
  151. #endif
  152.  
  153.  
  154. #endif /* __gen_nsIFileProtocolHandler_h__ */
  155.